home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
windows
/
wdj1096.zip
/
ZOLMAN.ZIP
/
ZVBDLG.ZIP
/
GENERIC.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-16
|
4KB
|
150 lines
// generic.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "generic.h"
#include "mainfrm.h"
#include "generdoc.h"
#include "genervw.h"
#include "zvbdlg.h"
#include "zspin.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGenericApp
BEGIN_MESSAGE_MAP(CGenericApp, CWinApp)
//{{AFX_MSG_MAP(CGenericApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGenericApp construction
CGenericApp::CGenericApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CGenericApp object
CGenericApp NEAR theApp;
/////////////////////////////////////////////////////////////////////////////
// CGenericApp initialization
BOOL CGenericApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
SetDialogBkColor(); // Set dialog background color to gray
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
EnableVBX(); // Initialize VBX support
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_GENERITYPE,
RUNTIME_CLASS(CGenericDoc),
RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
RUNTIME_CLASS(CGenericView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// create a new (empty) document
OnFileNew();
if (m_lpCmdLine[0] != '\0')
{
// TODO: add command line processing here
}
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public ZVBDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
CEdit m_edEdit1;
ZSpin m_spin;
//}}AFX_DATA
// Implementation
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//{{AFX_MSG(CAboutDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : ZVBDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
ZVBDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDC_EDIT1, m_edEdit1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, ZVBDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CGenericApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
BOOL CAboutDlg::OnInitDialog()
{
ZVBDialog::OnInitDialog();
m_spin.SubclassVBControl (this, IDC_SPIN1, TRUE);
m_spin.SetEditControl (m_edEdit1.m_hWnd);
return TRUE; // return TRUE unless you set the focus to a control
}